package cxt.com.springcloud.controller;

import cxt.com.springcloud.pojo.CommonResult;
import cxt.com.springcloud.pojo.Payment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @Auther: ChengXiaotian
 * @Date: 2020-06-08 16:46
 * @Description:
 */
@RestController
public class orderController {
    private static final String URL="http://127.0.0.1:8005";
    @Autowired
    private RestTemplate restTemplate;
    @GetMapping("/order/{id}")
    public CommonResult  tpayment(@PathVariable("id") Long id){
        ResponseEntity<CommonResult> forEntity = restTemplate.getForEntity(URL + "/getpayment/" + id, CommonResult.class);
        return new CommonResult<>(200,"查询成功",forEntity);
    }

}
